package com.cyzy.controller;

import com.cyzy.dto.Result;
import com.cyzy.pojo.Activity;
import com.cyzy.service.ActivityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author zxw
 * @create 2025-06-05 上午12:24
 */
@RestController
@RequestMapping("activity")
public class ActivityController {
    @Autowired
    private ActivityService activityService;
    //未开始活动（默认显示），开始时间正序
    @RequestMapping("/notStartActivity")
    private Result notStartActivity(@RequestParam("campusId") String campusId){
        List<Activity> list = activityService.notStartActivity(campusId);
        return Result.ok().data("list",list);
    }
    //进行中活动，开始时间倒序
    @RequestMapping("/startActivity")
    private Result startActivity(@RequestParam("campusId") String campusId){
        List<Activity> list = activityService.startActivity(campusId);
        return Result.ok().data("list",list);
    }
    //已结束活动，开始时间倒序
    @RequestMapping("/endActivity")
    private Result endActivity(@RequestParam("campusId") String campusId){
        List<Activity> list = activityService.endActivity(campusId);
        return Result.ok().data("list",list);
    }

}







